/**
 *	BitThunder Linker script for ARM.
 *
 **/

#include <bt_config.h>
#include "btlinker_config.h"

ENTRY(bt_reset)

_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : BT_CONFIG_LINKER_STACK_SIZE;
_IRQ_STACK_SIZE = DEFINED(_IRQ_STACK_SIZE) ? _IRQ_STACK_SIZE : BT_CONFIG_LINKER_IRQ_STACK_SIZE;

//_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x000;

_ABORT_STACK_SIZE = DEFINED(_ABORT_STACK_SIZE) ? _ABORT_STACK_SIZE : 0;
_SUPERVISOR_STACK_SIZE = DEFINED(_SUPERVISOR_STACK_SIZE) ? _SUPERVISOR_STACK_SIZE : 0;

MEMORY
{
#ifdef BT_CONFIG_LINKER_SECTION_FLASH
	FLASH		(rx)	: ORIGIN = BT_LINKER_FLASH_START_ADDRESS, LENGTH = BT_LINKER_FLASH_LENGTH
#endif
#ifdef BT_CONFIG_LINKER_SECTION_SRAM
	SRAM		(rwx)	: ORIGIN = BT_LINKER_SRAM_START_ADDRESS, LENGTH = BT_LINKER_SRAM_LENGTH
#endif
#ifdef BT_CONFIG_LINKER_SECTION_RAM
	RAM			(rwx)	: ORIGIN = BT_LINKER_RAM_ADDRESS, LENGTH = BT_CONFIG_LINKER_RAM_LENGTH
#endif
}

SECTIONS
{
#include <bitthunder.lds.h>
_end = .;
}
